MATLAB = /usr/local/MATLAB/R2011a
CC     = g++
FLAGS  = -I$(MATLAB)/extern/include
LIBS   = -L$(MATLAB)/bin/glnx64 \
				 -L$(MATLAB)/extern/lib/glnx64 \
				 -L$(MATLAB)/sys/os/glnx64 \
				 -lut -lmx -leng -lmex -lmat
CFLAGS = 
LINK   = $(CC)

DEBUG =

SRCS = $(wildward *.h)

#cd ~/Facultad/Tomassi/jss522_LDRcode/; setpaths; [Y,X]=getDATA('marcewithout.txt'); [aux, W0]=pc(X,2,'cov'); cd ~/Repos/sgmin-cplusplus; dbmex on; sgmin(Y,X,0,2,2,1,W0);

all : sgmin

sgmin : sgmin.c
	mex $(DEBUG) -largeArrayDims sgmin.c $(SRCS) CC='g++' $(FLAGS) $(LIBS) -llapack -lblas

.PHONY : clean run

clean :
	rm -rf *.o sgmin.mexa*

run : sgmin
	./sgmin
